<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>队列</title>
  <script src="./queue.js" charset="utf-8"></script>
</head>

<body>
  <div id="container">
  </div>
</body>
<script>
  var queue = new Queue();
  queue.enqueue("1");
  queue.enqueue("2");
  queue.enqueue("3");
  queue.enqueue("4");
  document.write("出队列: " + queue.dequeue() + "<br>");
  document.write("First: " + queue.first() + "<br>");
  document.write("Last: " + queue.last() + "<br>");

  queue.iterate();
  while (queue.hasNext()) {
    document.write(queue.item() + ",")
    queue.next();
  }
</script>
</body>

</html>
